//
// Created by lenovo on 2024/8/11.
//

#ifndef TREELIB_TREE_MULTITREE_BASICTREE_CLASS
#define TREELIB_TREE_MULTITREE_BASICTREE_CLASS

#include "./TemplateNode.h"
#include "./TemplateTree.h"
namespace TREE{
    template <typename T>
    class BasicTreeNode : public TemplateNode<T>{
    public :
        BasicTreeNode(T data) {
            this->_data = data ;
        }
        Node<T>*    parent      () override ;
        void        setChild    (T data , int n) override ;
        int         capacity    ()  const override ;
    };


    template<typename T>
    void BasicTreeNode<T>::setChild(T data, int n) {
        TemplateNode<T>::setChild(
                new BasicTreeNode<T>(data) ,
                n
        );
    }

    template<typename T>
    Node<T> *BasicTreeNode<T>::parent() {
        return nullptr;
    }

    template<typename T>
    int BasicTreeNode<T>::capacity() const {
        return INT_MAX;
    }

    template <typename T>
    using BasicTree = TemplateTree<BasicTreeNode<T>> ;
}

#endif //TREELIB_TREE_MULTITREE_BASICTREE_CLASS
